#!/bin/bash
#…………………………………………百度AI端口初始测试…………………………………………………………#
API_KEY=$(cat ./config |grep API_KEY| awk -F '=' '{print $2}')
SECRET_KEY=$(cat ./config |grep SECRET_KEY| awk -F '=' '{print $2}')
client='https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id='$API_KEY'&client_secret='$SECRET_KEY
access_token=$(curl -i -k $client |tr "," "\n"|grep access_token| awk -F ':' '{print $2}')
echo $access_token  >> test
